.class public Lcom/vividsolutions/jts/geomgraph/Edge;
.super Lcom/vividsolutions/jts/geomgraph/GraphComponent;
.source "Edge.java"


# instance fields
.field private depth:Lcom/vividsolutions/jts/geomgraph/Depth;

.field private depthDelta:I

.field eiList:Lcom/vividsolutions/jts/geomgraph/EdgeIntersectionList;

.field private env:Lcom/vividsolutions/jts/geom/Envelope;

.field private isIsolated:Z

.field private mce:Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;

.field pts:[Lcom/vividsolutions/jts/geom/Coordinate;


# direct methods
.method public constructor <init>([Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geomgraph/Label;)V
    .locals 1

    .line 77
    invoke-direct {p0}, Lcom/vividsolutions/jts/geomgraph/GraphComponent;-><init>()V

    .line 69
    new-instance v0, Lcom/vividsolutions/jts/geomgraph/EdgeIntersectionList;

    invoke-direct {v0, p0}, Lcom/vividsolutions/jts/geomgraph/EdgeIntersectionList;-><init>(Lcom/vividsolutions/jts/geomgraph/Edge;)V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->eiList:Lcom/vividsolutions/jts/geomgraph/EdgeIntersectionList;

    const/4 v0, 0x1

    .line 72
    iput-boolean v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->isIsolated:Z

    .line 73
    new-instance v0, Lcom/vividsolutions/jts/geomgraph/Depth;

    invoke-direct {v0}, Lcom/vividsolutions/jts/geomgraph/Depth;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->depth:Lcom/vividsolutions/jts/geomgraph/Depth;

    const/4 v0, 0x0

    .line 74
    iput v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->depthDelta:I

    .line 78
    iput-object p1, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    .line 79
    iput-object p2, p0, Lcom/vividsolutions/jts/geomgraph/GraphComponent;->label:Lcom/vividsolutions/jts/geomgraph/Label;

    return-void
.end method

.method public static updateIM(Lcom/vividsolutions/jts/geomgraph/Label;Lcom/vividsolutions/jts/geom/IntersectionMatrix;)V
    .locals 5

    const/4 v0, 0x0

    .line 60
    invoke-virtual {p0, v0, v0}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v1

    const/4 v2, 0x1

    invoke-virtual {p0, v2, v0}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v3

    invoke-virtual {p1, v1, v3, v2}, Lcom/vividsolutions/jts/geom/IntersectionMatrix;->setAtLeastIfValid(III)V

    .line 61
    invoke-virtual {p0}, Lcom/vividsolutions/jts/geomgraph/Label;->isArea()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 62
    invoke-virtual {p0, v0, v2}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v1

    invoke-virtual {p0, v2, v2}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v3

    const/4 v4, 0x2

    invoke-virtual {p1, v1, v3, v4}, Lcom/vividsolutions/jts/geom/IntersectionMatrix;->setAtLeastIfValid(III)V

    .line 63
    invoke-virtual {p0, v0, v4}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result v0

    invoke-virtual {p0, v2, v4}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(II)I

    move-result p0

    invoke-virtual {p1, v0, p0, v4}, Lcom/vividsolutions/jts/geom/IntersectionMatrix;->setAtLeastIfValid(III)V

    :cond_0
    return-void
.end method


# virtual methods
.method public addIntersection(Lcom/vividsolutions/jts/algorithm/LineIntersector;III)V
    .locals 3

    .line 181
    new-instance v0, Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p1, p4}, Lcom/vividsolutions/jts/algorithm/LineIntersector;->getIntersection(I)Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/vividsolutions/jts/geom/Coordinate;-><init>(Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 183
    invoke-virtual {p1, p3, p4}, Lcom/vividsolutions/jts/algorithm/LineIntersector;->getEdgeDistance(II)D

    move-result-wide p3

    add-int/lit8 p1, p2, 0x1

    .line 187
    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    array-length v2, v1

    if-ge p1, v2, :cond_0

    .line 188
    aget-object v1, v1, p1

    .line 193
    invoke-virtual {v0, v1}, Lcom/vividsolutions/jts/geom/Coordinate;->equals2D(Lcom/vividsolutions/jts/geom/Coordinate;)Z

    move-result v1

    if-eqz v1, :cond_0

    const-wide/16 p3, 0x0

    goto :goto_0

    :cond_0
    move p1, p2

    .line 202
    :goto_0
    iget-object p2, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->eiList:Lcom/vividsolutions/jts/geomgraph/EdgeIntersectionList;

    invoke-virtual {p2, v0, p1, p3, p4}, Lcom/vividsolutions/jts/geomgraph/EdgeIntersectionList;->add(Lcom/vividsolutions/jts/geom/Coordinate;ID)Lcom/vividsolutions/jts/geomgraph/EdgeIntersection;

    return-void
.end method

.method public addIntersections(Lcom/vividsolutions/jts/algorithm/LineIntersector;II)V
    .locals 2

    const/4 v0, 0x0

    .line 170
    :goto_0
    invoke-virtual {p1}, Lcom/vividsolutions/jts/algorithm/LineIntersector;->getIntersectionNum()I

    move-result v1

    if-ge v0, v1, :cond_0

    .line 171
    invoke-virtual {p0, p1, p2, p3, v0}, Lcom/vividsolutions/jts/geomgraph/Edge;->addIntersection(Lcom/vividsolutions/jts/algorithm/LineIntersector;III)V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_0
    return-void
.end method

.method public computeIM(Lcom/vividsolutions/jts/geom/IntersectionMatrix;)V
    .locals 1

    .line 213
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/GraphComponent;->label:Lcom/vividsolutions/jts/geomgraph/Label;

    invoke-static {v0, p1}, Lcom/vividsolutions/jts/geomgraph/Edge;->updateIM(Lcom/vividsolutions/jts/geomgraph/Label;Lcom/vividsolutions/jts/geom/IntersectionMatrix;)V

    return-void
.end method

.method public equals(Ljava/lang/Object;)Z
    .locals 8

    .line 225
    instance-of v0, p1, Lcom/vividsolutions/jts/geomgraph/Edge;

    const/4 v1, 0x0

    if-nez v0, :cond_0

    return v1

    .line 226
    :cond_0
    check-cast p1, Lcom/vividsolutions/jts/geomgraph/Edge;

    .line 228
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    array-length v2, v0

    iget-object v3, p1, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    array-length v3, v3

    if-eq v2, v3, :cond_1

    return v1

    .line 232
    :cond_1
    array-length v0, v0

    const/4 v2, 0x1

    move v3, v0

    const/4 v0, 0x0

    const/4 v4, 0x1

    const/4 v5, 0x1

    .line 233
    :goto_0
    iget-object v6, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    array-length v7, v6

    if-ge v0, v7, :cond_5

    .line 234
    aget-object v6, v6, v0

    iget-object v7, p1, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    aget-object v7, v7, v0

    invoke-virtual {v6, v7}, Lcom/vividsolutions/jts/geom/Coordinate;->equals2D(Lcom/vividsolutions/jts/geom/Coordinate;)Z

    move-result v6

    if-nez v6, :cond_2

    const/4 v4, 0x0

    .line 237
    :cond_2
    iget-object v6, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    aget-object v6, v6, v0

    iget-object v7, p1, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    add-int/lit8 v3, v3, -0x1

    aget-object v7, v7, v3

    invoke-virtual {v6, v7}, Lcom/vividsolutions/jts/geom/Coordinate;->equals2D(Lcom/vividsolutions/jts/geom/Coordinate;)Z

    move-result v6

    if-nez v6, :cond_3

    const/4 v5, 0x0

    :cond_3
    if-nez v4, :cond_4

    if-nez v5, :cond_4

    return v1

    :cond_4
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_5
    return v2
.end method

.method public getCoordinate()Lcom/vividsolutions/jts/geom/Coordinate;
    .locals 2

    .line 95
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    array-length v1, v0

    if-lez v1, :cond_0

    const/4 v1, 0x0

    aget-object v0, v0, v1

    return-object v0

    :cond_0
    const/4 v0, 0x0

    return-object v0
.end method

.method public getCoordinate(I)Lcom/vividsolutions/jts/geom/Coordinate;
    .locals 1

    .line 91
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    aget-object p1, v0, p1

    return-object p1
.end method

.method public getCoordinates()[Lcom/vividsolutions/jts/geom/Coordinate;
    .locals 1

    .line 88
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    return-object v0
.end method

.method public getDepthDelta()I
    .locals 1

    .line 116
    iget v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->depthDelta:I

    return v0
.end method

.method public getEdgeIntersectionList()Lcom/vividsolutions/jts/geomgraph/EdgeIntersectionList;
    .locals 1

    .line 123
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->eiList:Lcom/vividsolutions/jts/geomgraph/EdgeIntersectionList;

    return-object v0
.end method

.method public getEnvelope()Lcom/vividsolutions/jts/geom/Envelope;
    .locals 3

    .line 101
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->env:Lcom/vividsolutions/jts/geom/Envelope;

    if-nez v0, :cond_0

    .line 102
    new-instance v0, Lcom/vividsolutions/jts/geom/Envelope;

    invoke-direct {v0}, Lcom/vividsolutions/jts/geom/Envelope;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->env:Lcom/vividsolutions/jts/geom/Envelope;

    const/4 v0, 0x0

    .line 103
    :goto_0
    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    array-length v2, v1

    if-ge v0, v2, :cond_0

    .line 104
    iget-object v2, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->env:Lcom/vividsolutions/jts/geom/Envelope;

    aget-object v1, v1, v0

    invoke-virtual {v2, v1}, Lcom/vividsolutions/jts/geom/Envelope;->expandToInclude(Lcom/vividsolutions/jts/geom/Coordinate;)V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 107
    :cond_0
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->env:Lcom/vividsolutions/jts/geom/Envelope;

    return-object v0
.end method

.method public getMonotoneChainEdge()Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;
    .locals 1

    .line 127
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->mce:Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;

    if-nez v0, :cond_0

    new-instance v0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;

    invoke-direct {v0, p0}, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;-><init>(Lcom/vividsolutions/jts/geomgraph/Edge;)V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->mce:Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;

    .line 128
    :cond_0
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->mce:Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;

    return-object v0
.end method

.method public getNumPoints()I
    .locals 1

    .line 86
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    array-length v0, v0

    return v0
.end method

.method public isClosed()Z
    .locals 3

    .line 133
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    const/4 v1, 0x0

    aget-object v1, v0, v1

    array-length v2, v0

    add-int/lit8 v2, v2, -0x1

    aget-object v0, v0, v2

    invoke-virtual {v1, v0}, Lcom/vividsolutions/jts/geom/Coordinate;->equals(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public isIsolated()Z
    .locals 1

    .line 161
    iget-boolean v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->isIsolated:Z

    return v0
.end method

.method public isPointwiseEqual(Lcom/vividsolutions/jts/geomgraph/Edge;)Z
    .locals 4

    .line 250
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    array-length v0, v0

    iget-object v1, p1, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    array-length v1, v1

    const/4 v2, 0x0

    if-eq v0, v1, :cond_0

    return v2

    :cond_0
    const/4 v0, 0x0

    .line 252
    :goto_0
    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    array-length v3, v1

    if-ge v0, v3, :cond_2

    .line 253
    aget-object v1, v1, v0

    iget-object v3, p1, Lcom/vividsolutions/jts/geomgraph/Edge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    aget-object v3, v3, v0

    invoke-virtual {v1, v3}, Lcom/vividsolutions/jts/geom/Coordinate;->equals2D(Lcom/vividsolutions/jts/geom/Coordinate;)Z

    move-result v1

    if-nez v1, :cond_1

    return v2

    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_2
    const/4 p1, 0x1

    return p1
.end method

.method public setDepthDelta(I)V
    .locals 0

    .line 117
    iput p1, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->depthDelta:I

    return-void
.end method

.method public setIsolated(Z)V
    .locals 0

    .line 157
    iput-boolean p1, p0, Lcom/vividsolutions/jts/geomgraph/Edge;->isIsolated:Z

    return-void
.end method
